<?php
namespace App\Observers;

use App\Models\ApiUsers;

class ApiUserObserver{
    //这里需要定义一下在添加接口账号之前对密码进行处理
   //https://learnku.com/articles/6657/model-events-and-observer-in-laravel
   public function creating(ApiUsers $apiuser){
        //再添加账号之前对密码进行加密处理
        $apiuser->password = bcrypt(request()->get('password'));
   }
}
